package com.oms.app.user.service.impl;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.oms.app.sequence.service.impl.SequenceManager;
import com.oms.app.user.dao.IRoleDAO;
import com.oms.app.user.model.Role;
import com.oms.app.user.service.IRoleService;
import com.oms.core.service.impl.GeneralService;

/**
 * controller
 * @author wtj
 * @date Sep 10, 2012  10:23:45 PM
 */

public class RoleServiceImpl extends GeneralService<Object, String> implements IRoleService {

	@Override
	public int delete(String primaryKey) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Object get(String primaryKey) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public List getRoleList(HttpServletRequest request) {
		return ((IRoleDAO) dao).getRoleList(request);
	}

	@Override
	public boolean roleAddModule(Map map) {
		return ((IRoleDAO) dao).roleAddModule(map);
	}

	@Override
	public boolean saveOrUpdateRole(Role roleForm) {
		roleForm.setId(new Integer(SequenceManager.nextID("trole")));
		return ((IRoleDAO) dao).saveOrUpdateRole(roleForm);
	}

	@Override
	public boolean deleteRole(String PK) {
		return ((IRoleDAO) dao).deleteRole(PK);
	}

	@Override
	public List getGroupOfRole(Map map) {
		return ((IRoleDAO) dao).getGroupOfRole(map);
	}
	public List getUserOfRole(Map map){
		return ((IRoleDAO) dao).getUserOfRole(map);
	}

	@Override
	public boolean isRoleModule(Map map) {
		return ((IRoleDAO) dao).isRoleModule(map);
	};
	public boolean delRoleModule(Map map) {
		return ((IRoleDAO) dao).delRoleModule(map);
	};
	
	@Override
	public Role getShopManagerRole() {
		return ((IRoleDAO) dao).getShopManagerRole();
	}
}